package course.mymap;

import java.util.HashMap;

public class MyMap1 {
    public static void main(String[] args) {
        String s = "ASKDJFOASDIJFLDJFLAJSDFASIFHJERNA";

        HashMap<Character,Integer> hm = new HashMap<>();
        char [] chars = s.toCharArray();

        for (char chr : chars) {
            if(hm.containsKey(chr)){
                Integer integer = hm.get(chr);
                integer++;
                hm.put(chr,integer);
            }else {
                hm.put(chr,1);
            }
        }

        hm.forEach((key,value)-> System.out.println(key+":"+value));
    }
}
